<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function A(){
				var a=17;
				var b="hello";
				var d=new String("17");
				var c=true;
				alert(a==d);
				alert(parseInt("8a"));
				alert(parseInt("290a"));
				
				var i1=new Date();
				var year = i1.getYear() + 1900;
				var month = i1.getMonth() + 1;
				var date1 = i1.getDate();
				var hour = i1.getHours();
				var minutes = i1.getMinutes();
				var second = i1.getSeconds();
				var day = i1.getDay();
			   alert(year+"年"+month+"月"+date1+"日 "+hour+":"+minutes+":"+second+" "+day);
			}
			
			var a=new Array(2,3); 
			a[1]=45;
			a[2]=15;
			a[3]=56;
			document.write(a);
			var sum=0;
			for(var j=0;j<a.length;j++){
				sum+=a[j];
			}
			document.write("<pre>");
			document.write("\n数组的和为："+sum);
			document.write("</pre>");
			
			function B(){
				var objA=document.getElementById("b1");
				var objB=document.getElementById("b2");
				var objC=document.getElementById("b3");
				var objD=document.getElementById("b4");
				
				alert(objD.innerHTML);
				alert(objD.innerText);
				objB.value="改变了值";
				alert(objB.value);
			    objB.style.color="#f00";
			}
			
			
			function C(){
				  var obj=document.getElementsByName("n");
				  for(var j=0;j<obj.length;j++){
				  	    obj[j].value="abc";
				  	    obj[j].style.color="blue";
				  }
				   
			}
			
			function D(){
				var obj=document.getElementsByClassName("c1");
				for(var j=0;j<obj.length;j++){
					  obj[j].value="456";
					  obj[j].style.color="chartreuse";
				}
			}
			
			function F(){
				var obj=document.getElementsByTagName("input");
				for(var j=0;j<obj.length;j++){
					  obj[j].value="789";
					  obj[j].style.color="darkgreen";
				}
			}
			function fire(){
				var obj=document.getElementById("w1");
				obj.play();
			}
		</script>
	</head>
	<body>
		<audio src="../img/t1.wav" id="w1" loop="-1"></audio>
		<button onclick="fire()">唱歌呀！</button>
		<br/>
		<button onclick="A()" >按钮</button>
		
		<b id="b4">你好!!!</b>
		<label class="c1"  id="b1"></label>
		<p id="b2" class="c1">啦啦啦</p>
		<input id="b3" class="c1" type="text" name="n"/>
		<input  class="c1" type="text" name="n"/>
		<input  class="c1"  type="text" name="n"/>
	    <button onclick="B()" >按钮</button>
	   	<button onclick="C()" >按钮</button>
	   	<button onclick="D()" >按钮</button>
	    <button onclick="F()" >按钮</button>
	</body>
</html>
